package com.example.mcpdemo.controller;

import com.example.mcpdemo.entity.User;
import com.example.mcpdemo.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @RequestMapping("/save")
    public void save(User user) {
        userService.save(user);
    }

    @RequestMapping("/getUserById")
    public void list(String id) {
        User user = userService.getById(id);
        System.out.println(user);
    }

    @RequestMapping("/deletedById")
    public void delete(String id) {
        userService.removeById(id);
    }

    @RequestMapping("/update")
    public void update(User user) {

    }

}
